import java.util.Scanner;

public class Main1057 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x=0;
        for (int i = 1; i <= n; i++) {
            int a = i / 10000;//1
            int b = i / 1000 % 10;
            int c = i / 100 % 10;
            int d = i % 100 / 10;
            int e = i % 10;
            if (n < 32767) {
                if (i % 5 == 0) {
                    if (b == 5 || c == 5 || d == 5 || e == 5) {
                        x++;
                    }
                }
            }
        }System.out.println(x);
    }
}
